<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:insert="~{include :: header('修改密码')}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
	<form class="form-horizontal m" id="form-password-edit">
		<div class="form-group row" style="margin-top: 30px">
			<label class="col-sm-2 col-form-label is-required text-sm-right">账号</label>
			<div class="col-sm-8">
				<input name="mobile" th:field="${manager.mobile}" class="form-control" type="text" required disabled>
			</div>
		</div>
		<div class="form-group row">
			<label class="col-sm-2 col-form-label is-required text-sm-right">旧密码</label>
			<div class="col-sm-8">
				<input name="password" class="form-control" type="password">
			</div>
		</div>
		<div class="form-group row">
			<label class="col-sm-2 col-form-label text-sm-right">新密码</label>
			<div class="col-sm-8">
				<input name="loginPwd" class="form-control" type="password" >
			</div>
		</div>
		<div class="row">
			<label class="col-sm-2"></label>
			<div class="col-sm-10">
				<button type="button" class="btn btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
				<button type="button" class="btn btn-danger" onclick="parent.layer.closeAll()"><i class="fa fa-reply-all"></i>关 闭 </button>
			</div>
		</div>
	</form>
</div>
<th:block th:insert="~{include :: footer}" />
<script type="text/javascript">
	var prefix = "/user";
	$("#form-user-edit").validate({
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.post("/manager/resetPwd.json",$('#form-password-edit').serialize(),function (json) {
				if(json.code === 0){
					$.modal.msgSuccess("恭喜您，密码重置成功");
				}else {
					$.modal.alertError(json.msg);
				}
			})
		}
	}
</script>
</body>
</html>